import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { Toaster } from 'sonner';
import { Layout } from './components/Layout';
import Home from './pages/Home';
import WriteEntry from './pages/WriteEntry';
import EntryList from './pages/EntryList';
import EntryDetail from './pages/EntryDetail';
import Search from './pages/Search';

function App() {
  return (
    <Router>
      <Layout>
        <Routes>
          <Route path="/" element={<Home />} />
          <Route path="/write" element={<WriteEntry />} />
          <Route path="/write/:id" element={<WriteEntry />} />
          <Route path="/entries" element={<EntryList />} />
          <Route path="/entry/:id" element={<EntryDetail />} />
          <Route path="/search" element={<Search />} />
        </Routes>
      </Layout>
      
      {/* Toast notifications */}
      <Toaster 
        position="top-right"
        toastOptions={{
          style: {
            background: '#F7F5F3',
            border: '1px solid #A8B5A0',
            color: '#2D5A27',
          },
        }}
      />
    </Router>
  );
}

export default App
